
#include <BOpenGL>
#include <BImage>
#include <BPainter>
#include <BReadWrite>

#include "MyTexture.h"

BFont* font = 0;
MyTexture::MyTexture()
{
	font = new BFont("./font/���ż�����.TTF", 32);
	font->setEncoding(Encoding_GB2312);
	this->setSize(300, 300);
}
MyTexture::~MyTexture()
{

}

void MyTexture::draw() const
{
	int width = this->width();
	int height = this->height();
	
	BPainter painter(this);

	painter.setColor(BColor(1, 0, 0));
	painter.setLineWidth(10);
	painter.drawRect(1, 1, width-2, height-2);

	painter.drawLine(1, 1, width, height);

	painter.setColor(BColor(1, 1, 0));
	painter.setFont(font);
	painter.drawText(10, 10, "fuck");
}
